package afcp.alumni.model.db;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import afcp.alumni.model.base.DatastoreEntity;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

@PersistenceCapable
public class CsvColumn implements DatastoreEntity {

	@PrimaryKey
	@Persistent
	private Key key;
	// app key
	@Persistent
	private String id;
	@Persistent
	private String fileColumnName;
	@Persistent
	private String label;
	public CsvColumn(String id, String fileColumnName, String label) {
		this.id = id;
		this.fileColumnName = fileColumnName;
		this.label = label;
	}
	@Override
	public String getId() {
		return id;
	}
	@Override
	public Key getKey() {
		return key;
	}
	@Override
	public void setKeyWithAncestor(Key ancestorKey) {
		this.key = KeyFactory.createKey(ancestorKey, this.getClass().getSimpleName(), id);
	}
	public String getFileColumnName() {
		return fileColumnName;
	}
	public void setFileColumnName(String fileColumnName) {
		this.fileColumnName = fileColumnName;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String label) {
		this.label = label;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	@Override
	public String toString() {
		return id;
	}
}
